package com.cyurs.netty.nettySimple.buf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * @Author: Cyrus
 * @CreateDate: 2020/11/23
 */
public class NettyByteBuf {
    public static void main(String[] args) {
        ByteBuf buffer = Unpooled.buffer(10);
        for (int i = 0; i < 7; i++) {
            buffer.writeByte(i);
        }
        System.out.println("capacity=" + buffer.capacity());

        for (int i = 0; i < buffer.capacity(); i++) {
            System.out.print(buffer.readByte()+" ");
        }
    }
}
